package com.sixstones.fragment.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sixstones.fragment.dao.FragmentDao;
import com.sixstones.fragment.entity.FragmentEntity;
import com.sixstones.fragment.service.FragmentService;
import com.sixstones.fragment.vo.FragmentException;

@Service
public class FragmentServiceImpl implements FragmentService {

	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private FragmentDao dao;

	@Override
	@Transactional
	public int addNewFragment(FragmentEntity fragment) throws FragmentException {
		return dao.addFragment(fragment);
	}

	@Override
	public String getFragmentContent(int fragmentId) {
		return dao.getFragmentContent(fragmentId);
	}
}
